"""
登录页面类
"""
from selenium.webdriver.common.by import By
from framwork.pages.base_page import BasePage


class LoginPage(BasePage):
    url = "/crm"
    username_locator = (By.NAME, 'name')
    password_locator = (By.NAME, 'password')
    btn_locator = (By.NAME, 'submit')

    def input_username(self, username):
        """输入用户名"""
        self.find_element(self.username_locator).send_keys(username)

    def input_password(self, password):
        """输入密码"""
        self.send_keys(self.password_locator, password)

    def click_btn(self):
        """点击登录"""
        self.click(self.btn_locator)
